FROM ubuntu:jammy
ENV DEBIAN_FRONTEND=noninteractive

RUN \
    apt update && \
    apt install -y apache2 && \
    a2enmod dav_fs && \
    a2enmod dav && \
    mkdir /var/www/html/site && \
    chown www-data:www-data /var/www/html/site

WORKDIR /etc/apache2

COPY httpd/000-default.conf     sites-available/000-default.conf
COPY httpd/webdav.conf          conf-available/
COPY httpd/readonly.conf        conf-available/

CMD [ "apachectl", "-D", "FOREGROUND" ]
